import request from "@/utils/request";
import { baseURL } from "@/config/settings";

const getProcessImage =
  baseURL + "/resourcevisualization/process/viewProcessImage/";

export { getProcessImage };

export function getApplyListInfoByApplyBy(data) {
  return request({
    url: "/resourcevisualization/apply/getApplyListInfoByApplyBy/" + data,
    method: "get",
  });
}

export function getResourceCacheInfoById(data) {
  return request({
    url: "/resourcevisualization/apply/getResourceCacheInfoById/" + data,
    method: "get",
  });
}

export function remarkDeleteApplyInfoById(data) {
  return request({
    url:
      "/resourcevisualization/apply/remarkDeleteApplyInfoById?applyId=" + data,
    method: "post",
  });
}

export function addApplyInfo(data) {
  return request({
    url: "/resourcevisualization/apply/addApplyInfo/",
    method: "post",
    data,
  });
}

export function updateApplyInfo(data) {
  return request({
    url: "/resourcevisualization/apply/updateApplyInfo/",
    method: "post",
    data,
  });
}

export function submitApply(data) {
  return request({
    url: "/resourcevisualization/process/submitApply?applyId=" + data,
    method: "post",
  });
}

export function cancelApply(data) {
  return request({
    url: "/resourcevisualization/process/cancelApply?applyId=" + data,
    method: "post",
  });
}

export function auditApply(data) {
  return request({
    url: "/resourcevisualization/process/auditApply",
    method: "post",
    data,
  });
}

export function assignResource(data) {
  return request({
    url: "/resourcevisualization/process/assignResource",
    method: "post",
    data,
  });
}

export function returnResource(data) {
  return request({
    url: "/resourcevisualization/process/returnResource?applyId=" + data,
    method: "post",
  });
}

export function freeResource(data) {
  return request({
    url: "/resourcevisualization/process/freeResource",
    method: "post",
    data,
  });
}
